<%--
  Created by IntelliJ IDEA.
  User: jerry
  Date: 15/1/31
  Time: 下午4:41
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<head>
    <jsp:include page="/pages/include/includeCSS.jsp"></jsp:include>
    <script src="${pageContext.request.contextPath}/pages/assets/js/jquery-1.11.1.min.js"></script>
    <title>项目管理页面</title>
</head>
<body class="page-body">

<jsp:include page="/pages/admin/include/head_Settings-Pane.jsp"></jsp:include>
<jsp:include page="/pages/admin/include/leftPane.jsp"></jsp:include>

<jsp:include page="/pages/admin/include/includeHeadBar.jsp"></jsp:include>


<div class="page-loading-overlay">
    <div class="loader-2"></div>
</div>


<div class="page-title">

    <div class="title-env">
        <h1 class="title">项目管理</h1>

        <p class="description"> 项目列表页 </p>
    </div>

    <div class="breadcrumb-env">

        <ol class="breadcrumb bc-1">
            <li>
                <a href="${pageContext.request.contextPath}"><i class="fa-home"></i>首页</a>
            </li>

            <li class="active">

                <strong><i class="fa-list"></i>项目列表</strong>
            </li>
        </ol>

    </div>

</div>


<!-- poject view list context -->

<a href="${pageContext.request.contextPath}/app/manager/addPojectView">
    <button class="btn btn-danger btn-lg "  >
        <i class="fa-align-center"></i>
        <span >添加</span>

    </button>
</a>

<!-- Basic Setup -->
<div class="panel panel-default">
<div class="panel-heading">
    <h3 class="panel-title">项目列表</h3>

    <div class="panel-options">
        <a href="#" data-toggle="panel">
            <span class="collapse-icon">&ndash;</span>
            <span class="expand-icon">+</span>
        </a>
        <a href="#" data-toggle="remove">
            &times;
        </a>
    </div>
</div>


<div class="panel-body">


<table id="pojectTB" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>

    <th>编号</th>
    <th>项目名称</th>
    <th>后台地址</th>
    <th>后台密码</th>
    <th>案场经理</th>
    <th>置业顾问</th>
    <th>操作</th>

</tr>
</thead>


<tbody >
<c:forEach var="pojectList" items="${pojectList}">
<tr>
    <td>
            ${pojectList.id.id}
    </td>
    <td>${pojectList.id.projectName}</td>
    <td>
            ${pojectList.id.backstageAddress}
    </td>
    <td id="restId">

                <span id="restCoderView${pojectList.id.id}">${pojectList.id.backstagePassword}</span>
        &nbsp;&nbsp;
                <button class="btn btn-blue btn-xs" id="" onclick="restCoder(${pojectList.id.id})">
                    <span >重置</span>
                    <i class="fa-refresh"></i>
                </button>
    </td>
    <td>
            ${pojectList.id.siteManagerNumber}
    </td>
    <td>
            ${pojectList.id.counselorNumber}
    </td>
    <td>
        <a href="${pageContext.request.contextPath}/app/manager/editPoject?id=${pojectList.id.id}">
        <button class="btn btn-blue btn-xs "  >
            <span >编辑</span>
            <i class="fa-pencil"></i>
        </button>
        </a>

    </td>



    </tr>
</c:forEach>




    </tbody>
    </table>

    </div>
    </div>


    <jsp:include page="/pages/admin/include/includeFooter.jsp"></jsp:include>

    <script>

    function restCoder(data){
    $.ajax({
    url: "${pageContext.request.contextPath}/app/manager/restCoder",
    method: 'POST',
    dataType: 'json',


    success: function(resp) {
       var number = document.getElementById("restCoderView"+data);

    $("#restCoderView"+data).html("");
    $("#restCoderView"+data).append(resp.coder);

    }
    });
    }

    $("#pojectTB").each(function(){
        $("#restBtn").click(function(){
            var but_id = $("#restId").val();
            alert(but_id);
        });
    });

    function addObjectModel(){
    var row = $("#restCoderView").clone(); //克隆模板，创建一个新数据行
    }

    </script>

    <!-- Imported styles on this page -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/pages/assets/js/datatables/dataTables.bootstrap.css">

    <!-- Bottom Scripts -->
    <script src="${pageContext.request.contextPath}/pages/assets/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/TweenMax.min.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/resizeable.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/joinable.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/xenon-api.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/xenon-toggles.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/datatables/js/jquery.dataTables.min.js"></script>


    <!-- Imported scripts on this page -->
    <script src="${pageContext.request.contextPath}/pages/assets/js/datatables/dataTables.bootstrap.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
    <script src="${pageContext.request.contextPath}/pages/assets/js/datatables/tabletools/dataTables.tableTools.min.js"></script>


    <!-- JavaScripts initializations and stuff -->
    <script src="${pageContext.request.contextPath}/pages/assets/js/xenon-custom.js"></script>

    </body>
    </html>
